<?php
/**
 * @link http://www.yiiframework.com/
 * @copyright Copyright (c) 2008 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

namespace app\assets;

use yii\web\AssetBundle;
use yii\web\View;

/**
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @since 2.0
 */
class AppAsset extends AssetBundle
{
    public $basePath = '@webroot';
    public $baseUrl = '@web';
    public $css = [
        'css/bootstrap.css',
        'css/animate.css',
        'css/font-awesome.min.css',
        'css/iconfont.css',
        'css/simple-line-icons.css',
        'css/font.css',
        'css/app.css',
        "css/gritter.css",
        "js/chosen/chosen.css",
        "js/kindeditor/themes/default/default.css",
        "js/sweet/sweetalert.css",
        "css/fileinput.css",
        "js/chosen/chosen.css",
        'js/datepicker/datepicker.css',
        'css/fileupload/jquery.fileupload.css',
        'css/fileupload/upload-kit.css',
    ];
    public $js = [
        "js/jquery.min.js",
        "js/bootstrap.js",
        'js/app.js',
        "js/slimscroll/jquery.slimscroll.min.js",
        "js/app.plugin.js",
        "js/parsley/parsley.min.js",
        "js/gritter.js",
        "js/bootbox/bootbox.js",
        "js/validate/jquery.validate.js",
        "js/validate/jquery.validate.methods.js",
        "js/form/jquery_form_min.js",
        "js/wysiwyg/jquery.hotkeys.js",
        "js/wysiwyg/bootstrap-wysiwyg.js",
        "js/chosen/chosen.jquery.min.js",
        "js/kindeditor/kindeditor-min.js",
        "js/kindeditor/lang/zh_CN.js",
        "js/sweet/sweetalert.min.js",
//        "js/file-input/bootstrap-filestyle.min.js",
        "js/fileinput/fileinput.js",
        "js/fileinput/fileinput_locale_zh.js",
        "js/chosen/chosen.jquery.min.js",
        'js/fileupload/load-image.all.min.js',
        'js/jquery.ui.widget.js',
        'js/fileupload/jquery.iframe-transport.js',
        'js/fileupload/jquery.fileupload.js',
        'js/fileupload/jquery.fileupload-process.js',
        'js/fileupload/jquery.fileupload-image.js',
        'js/fileupload/jquery.fileupload-validate.js',
        'js/fileupload/upload-kit.js',
        'js/datepicker/bootstrap-datepicker.js'
    ];

    public $jsOptions = ['position' => View::POS_HEAD];

    public $depends = [
//        'yii\web\YiiAsset',
//        'yii\bootstrap\BosotstrapAsset',
    ];

    //定义按需加载JS方法，注意加载顺序在最后
    public static function addScript($view, $jsfile) {
        $view->registerJsFile($jsfile, [AppAsset::className(), 'depends' => 'app\assets\AppAsset']);
    }

    //定义按需加载css方法，注意加载顺序在最后
    public static function addCss($view, $cssfile) {
        $view->registerCssFile($cssfile, [AppAsset::className(), 'depends' => 'app\assets\AppAsset']);
    }
}
